package com.maicss.coursedesign.types;

import com.maicss.coursedesign.dao.UserDao;

public class User {
    private int id;
    private String name;
    private String password;

    private int head;

    public User(int id, String name, String password, int head){
        this.id = id;
        this.name = name;
        this.password = password;
        this.head = head;
    }

    public int getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public boolean setName(String name) {
        boolean res = UserDao.ChangeUserName(id,name);
        if (res){
            this.name = name;
        }
        return res;
    }

    public String getPassword() {
        return password;
    }

    public boolean setPassword(String password) {
        boolean res = UserDao.ChangePassword(id,password);
        if (res){
            this.password = password;
        }
        return res;
    }

    public int getHead() {
        return head;
    }

    public void setHead(int head) {
        this.head = head;
    }
}
